<?php
namespace Home\Controller;
use Think\Controller;
class AdviceController extends Controller {
	//新增地址
    public function addadvice(){

       $advice=M("Advice");

      $advicecontent=$_POST["content"];
      $userid=$_POST["userid"];

       $newdata["advice_content"]=$advicecontent;
       $newdata["user_id"]=$userid;

       $result=$advice->add($newdata);       
       if ($result) {
          $this->ajaxReturn(array("code"=>200,"message"=>"新增成功","data"=>$result),"JSON");
       }else{
            $this->ajaxReturn(array("code"=>500,"message"=>"新增失败","data"=>NULL),"JSON");
       }  

    }
}
